Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ


Displaying Raw β€’ View rendered β€’ Download

docs/en/developer/codebase.md ba63f5911a128c8a9bd2a8cdb567a76f09df7e01 (ba63f591) Text, 4.38 KB

---
title: Codebase
parent: Developer Guide
nav_order: 2
last_updated: 2026-07-08
aliases:
Tff7b72- repository-layout
Tff7b72- project-structure
Tc9d1d9 - source-code
Tc9d1d9---

Tc9d1d9# Codebase

Repository layout, namespacing conventions, and build system overview.

Tc9d1d9## Repository Structure

Ta5d6ff```
Meshtastic-Android/
β”œβ”€β”€ androidApp/ # Android application module
β”‚ β”œβ”€β”€ src/main/ # Shared Android code
β”‚ β”œβ”€β”€ src/google/ # Google Play flavor (Gemini, proprietary)
β”‚ └── src/fdroid/ # F-Droid flavor (FOSS-only)
β”œβ”€β”€ desktopApp/ # Desktop JVM application
β”œβ”€β”€ feature/ # Feature modules (KMP)
β”‚ β”œβ”€β”€ intro/
β”‚ β”œβ”€β”€ messaging/
β”‚ β”œβ”€β”€ connections/
β”‚ β”œβ”€β”€ map/
β”‚ β”œβ”€β”€ node/
β”‚ β”œβ”€β”€ settings/
β”‚ β”œβ”€β”€ firmware/
β”‚ β”œβ”€β”€ docs/
β”‚ β”œβ”€β”€ wifi-provision/
β”‚ β”œβ”€β”€ widget/
β”‚ β”œβ”€β”€ discovery/
β”‚ └── car/
β”œβ”€β”€ core/ # Core infrastructure modules (KMP)
β”‚ β”œβ”€β”€ barcode/
β”‚ β”œβ”€β”€ ble/
β”‚ β”œβ”€β”€ common/
β”‚ β”œβ”€β”€ data/
β”‚ β”œβ”€β”€ database/
β”‚ β”œβ”€β”€ datastore/
β”‚ β”œβ”€β”€ di/
β”‚ β”œβ”€β”€ domain/
β”‚ β”œβ”€β”€ konsist/
β”‚ β”œβ”€β”€ model/
β”‚ β”œβ”€β”€ navigation/
β”‚ β”œβ”€β”€ network/
β”‚ β”œβ”€β”€ nfc/
β”‚ β”œβ”€β”€ prefs/
β”‚ β”œβ”€β”€ repository/
β”‚ β”œβ”€β”€ resources/
β”‚ β”œβ”€β”€ service/
β”‚ β”œβ”€β”€ takserver/
β”‚ β”œβ”€β”€ testing/
β”‚ └── ui/
β”œβ”€β”€ baselineprofile/ # Baseline Profile generation for :androidApp
β”œβ”€β”€ screenshot-tests/ # Compose Preview screenshot tests (visual-regression gate)
β”œβ”€β”€ docs-screenshots/ # Doc-framed composition screenshots (generate-only, not CI-gated)
β”œβ”€β”€ build-logic/ # Convention plugins and build helpers
β”‚ └── convention/
β”œβ”€β”€ docs/ # Documentation source (markdown)
β”‚ └── en/ # English source; other locales live under docs/<locale>/user/
β”‚ β”œβ”€β”€ user/
β”‚ └── developer/
β”œβ”€β”€ gradle/ # Gradle wrapper and version catalog
β”‚ └── libs.versions.toml
β”œβ”€β”€ specs/ # Feature specifications
└── .github/workflows/ # CI/CD workflows
```

Tc9d1d9## Namespacing Convention

All Kotlin packages follow the pattern:
Ta5d6ff```
org.meshtastic.{layer}.{module}.{subpackage}
```

Examples:
Tff7b72- Ta5d6ff`org.meshtastic.core.navigation` β€” core navigation module
Tff7b72- Ta5d6ff`org.meshtastic.feature.docs.ui` β€” docs feature UI package
Tff7b72- Ta5d6ff`org.meshtastic.app.di` β€” app DI configuration

Tc9d1d9## Build System

Tc9d1d9### Gradle Kotlin DSL

All build files use Kotlin DSL (Ta5d6ff`.gradle.kts`). Configuration:

Tff7b72- **Version catalog:** Ta5d6ff`gradle/libs.versions.toml`
Tff7b72- **Convention plugins:** Ta5d6ff`build-logic/convention/`
Tff7b72- **Settings:** Ta5d6ff`settings.gradle.kts`

Tc9d1d9### Convention Plugins

Located in Ta5d6ff`build-logic/convention/src/main/kotlin/`:

| Plugin | Purpose |
|--------|---------|
| Ta5d6ff`meshtastic.kmp.feature` | Standard feature module setup |
| Ta5d6ff`meshtastic.kmp.jvm.android` | JVM + Android target configuration |
| Ta5d6ff`meshtastic.kotlinx.serialization` | Serialization plugin setup |

Tc9d1d9### Build Variants (Android)

| Flavor | Description |
|--------|-------------|
| Ta5d6ff`google` | Google Play distribution; includes proprietary APIs |
| Ta5d6ff`fdroid` | F-Droid distribution; FOSS-only dependencies |

Tc9d1d9### Key Gradle Tasks

Ta5d6ff```Ta5d6ffbash
T8b949e# Compile check across all KMP targets
./gradlew kmpSmokeCompile

T8b949e# Run all tests
./gradlew allTests

T8b949e# Code quality
./gradlew spotlessCheck detekt

T8b949e# Android build
./gradlew assembleGoogleDebug assembleFdroidDebug

T8b949e# Desktop run
./gradlew :desktopApp:run

T8b949e# Desktop native installers for the current OS (DMG / MSI+EXE / DEB+RPM+AppImage)
./gradlew :desktopApp:packageReleaseDistributionForCurrentOS

T8b949e# API reference (Dokka HTML β†’ build/dokka/html)
./gradlew dokkaGeneratePublicationHtml
Ta5d6ff```

Tc9d1d9## Version Catalog Highlights

Key dependencies in Ta5d6ff`gradle/libs.versions.toml`:

| Category | Library |
|----------|---------|
| Compose | Compose Multiplatform (JetBrains) |
| Navigation | Navigation 3 |
| DI | Koin (annotations) |
| Serialization | kotlinx.serialization |
| Database | Room KMP |
| Networking | Ktor |
| Markdown | multiplatform-markdown-renderer |
| Testing | kotlin-test, compose-ui-test |

---

Served by rngit 1.5.0 - Generated in 0.13s